GDI重绘 无边框窗体的拖动(FormBorderStyle=none以后窗体是无法拖动的)
private Point mouseOff;//鼠标移动位置变量
private bool leftFlag;//鼠标是否为左键
/// <summary>
/// 圆形图像框的绘制
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pictureBox3_Paint(object sender, PaintEventArgs e)
{
GraphicsPath gp = new GraphicsPath();
gp.AddEllipse(pictureBox3.ClientRectangle);
Region region = new Region(gp);
pictureBox3.Region = region;
gp.Dispose();
region.Dispose(); }
/// <summary>
/// 关闭
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void pictureBox4_Click(object sender, EventArgs e)
{
this.Close();
} private void pictureBox4_MouseEnter(object sender, EventArgs e)
{
if (Convert.ToInt16(pictureBox4.Tag) == 0)
{
pictureBox4.Image = Properties.Resources.btn_close_highlight;
}
评论